import request from "@/utils/request"

// 查询个人列表
export function queryList(query) {
  return request({
    url: '/user/distribution/user/list',
    method: 'get',
    params: query
  })
}

// 查询分公司列表
export function queryBranchList(query) {
  return request({
    url: '/user/distribution/city/list',
    method: 'get',
    params: query
  })
}

// 查询代理列表
export function queryAgentList(query) {
  return request({
    url: '/user/distribution/agent/list',
    method: 'get',
    params: query
  })
}

// 新增分公司信息
export function addInfo(query) {
  return request({
    url: '/user/distribution/user/add',
    method: 'post',
    data: query
  })
}

// 获取分公司信息
export function queryInfo(query) {
  return request({
    url: '/user/distribution/user/' + query,
    method: 'get',
    params: query
  })
}

// 修改分公司信息
export function editInfo(query) {
  return request({
    url: '/user/distribution/user/edit',
    method: 'post',
    data: query
  })
}


// 删除分公司信息
export function deleteInfo(query) {
  return request({
    url: '/user/distribution/user/delete?ids=' + query,
    method: 'get',
  })
}

// 分公司代理级联列表
export function queryBranchAndAgent(query) {
  return request({
    url: '/user/distribution/city/getBranchAndAgentUser',
    method: 'get',
  })
}

// 获取代理下个人用户
export function queryUserInfoByAgentIdagentId(query) {
  return request({
    url: '/user/distribution/user/getUserInfoByAgentId',
    method: 'get',
    params: query
  })
}

//查询分公司下代理和个人用户
export function queryUserInfoByBranchId(query) {
  return request({
    url: '/user/distribution/city/getBreachByUserId',
    method: 'get',
    params: query
  })
}

//查询分公司下代理和个人用户
export function queryDistributionLimit(query) {
  return request({
    url: '/user/distribution/limit/getLimit',
    method: 'get',
    params: query
  })
}
